<extend name="Public:base" />
<block name="content">
	<form id="validation-form" method="post" action="{:U('Comment/Del')}">
    <style type="text/css">
		.popuping{
			z-index: 1050;
			width: auto;
			padding: 10px;
			margin-right: auto;
			margin-left: auto;

		}
		.bootbox.fade .popuping{
			-webkit-transform: translate(0,-25%);
			-ms-transform: translate(0,-25%);
			transform: translate(0,-25%);
			-webkit-transition: -webkit-transform .3s ease-out;
			-moz-transition: -moz-transform .3s ease-out;
			-o-transition: -o-transform .3s ease-out;
			transition: transform .3s ease-out;
		}
		.bootbox.in .popuping{
			-webkit-transform: translate(0,0);
			-ms-transform: translate(0,0);
			transform: translate(0,0);
		}
		.bootbox.in .popuping-content{
			position: relative;
			background-color: #fff;
			border: 1px solid #999;
			border: 1px solid rgba(0,0,0,0.2);
			border-radius: 6px;
			outline: 0;
			-webkit-box-shadow: 0 3px 9px rgba(0,0,0,0.5);
			box-shadow: 0 3px 9px rgba(0,0,0,0.5);
			background-clip: padding-box;
			padding: 20px;
			margin: 100px auto 0;
		}
    </style>
    <div class="table-responsive">
		 <table class="table table-striped table-bordered table-hover search-form" id="nav-table">
			<thead>
		    <th>师傅账号：<input name="account" type="text" placeholder="" value="{:I('account')}"/>

		    师傅姓名：<input name="master" type="text" placeholder="" value="{:I('master')}"/>


				<a class="btn btn-primary btn-sm radius5" href="javascript:;" id="search" url="{:U('Comment/Manage')}">查询</a>

				</th>
			</thead>
		</table>
    </div>
	<div class="table-responsive">
		<table class="table table-striped table-bordered table-hover" id="mytable">
			<thead>
				<tr>
					<th>师傅账号</th>
					<th>师傅姓名</th>
					<th>总订单量</th>
					<th>总星级数</th>
					<th>平均星级</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
					<volist name="Manage" id="vo">
					<tr>
						<td>{$vo.worker_acc}</td>
						<td>{$vo.id_name}</td>
						<td>{$vo.order_count}</td>
						<td>{$vo.star}</td>
						<td>{$vo.grade}</td>
						<td>
							<php>if($vo['is_black']==1){</php>
							<span style="color:darkgoldenrod;text-align: center;">{$vo.date}<br>暂停接单</span>
							<php>}else if($vo['grade']>10){</php>
							<a href="#" id="add" name="{$vo.user_id}" class="btn btn-xs btn-info radius5">加入黑名单</a>
							<php>}</php>
						</td>
					</tr>
					</volist>
					<tr>
						<td colspan="20" class="page">{$page}</td>
					</tr>
			</tbody>
		</table>
	</div>
</form>
	<div class="bootbox modal fade">
		<div class="popuping">
			<div class="popuping-content" style="width: 450px;">
				<div class="ui-jqdialog-content ui-widget-content" id="editcntgrid-table">
					<div>
						<form name="FormPost" id="FrmGrid_grid-table" class="FormGrid" onsubmit="return false;" style="width:auto;overflow:auto;position:relative;height:auto;">
							<table id="TblGrid_grid-table" class="EditTable" cellspacing="0" cellpadding="0" border="0">
								<tbody>
								<tr id="FormError" style="display:none">
									<td class="ui-state-error" colspan="2"></td>
								</tr>
								<tr style="display:none" class="tinfo">
									<td class="topinfo" colspan="2"></td>
								</tr>
								<tr rowpos="1" class="FormData" id="tr_id">
									<td class="CaptionTD">请设置暂停接单时长：</td>
									<td class="DataTD">&nbsp;
										<input style="width: 200px" type="text" name="days" value="" role="textbox" class="FormElement ui-widget-content ui-corner-all">天
									</td>
								</tr>
								</tbody>
								<input type="hidden" name="present" value=""/>
							</table>
						</form>
						<div style="text-align: center;">
							<button class="btn btn-xs btn-info radius5 marginT10" id="save">保存</button>
							<button class="btn btn-xs btn-info radius5 marginT10" style="margin-left: 100px;" id="cancel">取消</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</block>
<block name="javascript">
<script>
$(function(){

	$("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });
});


	$("[id=add]").click(function(){
		$("input[name=present]").val(this.name);
		$("body").append("<div class=\"modal-backdrop fade in\"></div>");
		$(".bootbox.modal.fade").addClass("in").show(400);
	});

	$('#cancel').click(function(){
		$(".bootbox.modal.fade").addClass("in").hide(400);
		setTimeout(function(){
			$(".modal-backdrop.fade.in").remove()
		},200);
	});

	$("#save").click(function(){
		var day = $("input[name=days]").val();
		var user_id = $("input[name=present]").val();
		$.ajax({
			url:"{:U('Comment/JoinBlack')}",
			type:"post",
			data:{
				user_id : user_id,
				day : day
			},
			success:function(data){
				if(data==1){
					$.jbox.tip("修改成功！", 'loading');
					window.setTimeout(function () {window.location.reload(); }, 500);
				}else{
					$.jbox.info('修改失败！', '提示');
				}
			}
		})
	});

</script>
</block>